﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DongDong.Common;
public partial class GRZX_Mess : Base
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string Check = Request["Check"];
            if (!string.IsNullOrEmpty(Check))
            {
                Response.Clear();
                if (Check == "GetMess")
                {
                    int MessID = Misc.ConvertToInt(Request["MessID"]);
                    ZNXX objZNXX = ZNXX.GetByID(MessID);
                    if (objZNXX == null)
                    {
                        Response.Write("系统错误");

                    }
                    else
                    {
                        objZNXX.Status = (int)ZNXX.statusXX.已读;
                        objZNXX.Update();
                        Response.Write(objZNXX.Des);
                    }
                }
                Response.End();

            }
            else {
                SetMeta();
            }

        }

    }

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        PopulateWDXX();
    }

    public void PopulateWDXX()
    {
        Client objClient = Client.GetCurrent();
        if (objClient == null)
            return;
        lstWDXX.DataSource = ZNXX.GetAllInUserIDByConditon(0, objClient.ID, txtTimeFrom.Text, txtTimeTo.Text, 0, "", (int)ZNXX.ZXXXType.前台);
        lstWDXX.DataBind();
    }


    protected void Pager_PreRender(object sender, EventArgs e)
    {
        if (lstWDXX.Items.Count == 0)
            PopulateWDXX();
    }
    protected void lstWDXX_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
    {
        PopulateWDXX();

    }
    public string ReturnZT(object ZT)
    {
        string ZhuangTai = "";
        if ((int)ZT == (int)ZNXX.statusXX.未读)
        {
            ZhuangTai = "<img alt='未读' width='20px' height='20px' src='../../Scripts/jquery-easyui-1.3.1/themes/default/images/messager_info.gif'><span style='color:red'>" + "未读" + "</span>";
        }
        else
        {
            ZhuangTai = "已读";
        }
        return ZhuangTai;
    }

    public void SetMeta()
    {
        this.SetMeta("我的消息-我是学员-求学网", "求学网_家教辅导_网上家教辅导_企业培训_个人培训_网上培训", "求学网是一个给您提供网上家教辅导的平台，方便您无论在哪里都能够学习到新的东西");
    }
}